#ifndef _SERVER_H_
#define _SERVER_H_

#include "protocol.hpp"
#include "socket.hpp"
#include "player.hpp"
#include "object.hpp"

#include "medved/manager.hpp"
#include "medved/shared_ptr.hpp"

namespace Server
{

using namespace Server;
using namespace Net;
using namespace Proto;

// crazy mixin
struct PlayerData : public Player
{
	Medved::SharedPtr<TCPSocket> socket;
	Client2Server::SpeedAdjust speedAdjust;
	Client2Server::Fire fire;
	char nick[NICK_LENGTH + 1];

	PlayerData(TCPSocket *_socket) :
		Player(), socket(_socket)
	{}
};

// another one :)
struct ObjectData : public ObjectHolder
{
	ObjectData() : playerId(-1) {}
	void enter(PlayerData &pd);
	void leave(PlayerData &pd);

	int playerId;
};

enum
{
	BONUS_PROBABILITY = 30
};

}

#endif
